Listing all Objects in a Module

Hello,

I'm trying to list all my Object Names of a Module. I am using following code:

 

int fillModsList(DBE dbeList)
{
    i=1
    string objectName =""
    Object o
    Module m = current
    
     empty(dbeList)
    
    for o in m do
    {
        objectName = o."Object Text"

        insert(dbeList,i, objectName)
        i++
    }
    
    return noElems dbeList
    
}

 

I want to display the dbeList afterwards, but it is empty. I had a different script, where the modules of a project are displayed. This works perfectly fine.

So can someone help me out here? :)

 

Nikki


Nikkolsche - Wed Aug 30 06:48:15 EDT 2017

Re: Listing all Objects in a Module
O.Wilkop - Wed Aug 30 07:31:01 EDT 2017

You need to let your i start at 0 (alternatively insert at noElems(dbeList) ), or the insert operation tries to insert at a non-existing position.

Re: Listing all Objects in a Module
Nikkolsche - Wed Aug 30 07:36:13 EDT 2017

O.Wilkop - Wed Aug 30 07:31:01 EDT 2017

You need to let your i start at 0 (alternatively insert at noElems(dbeList) ), or the insert operation tries to insert at a non-existing position.

Thank you! It works now!